﻿package Component {
	import Map.Block;
	import flash.utils.Timer;
	import Map.Trap;
	
	public class Slab extends Block {		
		
		private var timer:Timer;
		private var _trap:Trap;
		public function set trap(_trap:Trap) {
			this._trap = _trap;
		}
		
		public function Slab() {
			timer = new Timer(60*1000,1);
			timer.stop();
            timer.addEventListener("timer", activate);
			activate();
		}
		
		public function disactivate() {
			gotoAndStop(2);
			timer.start();
			_trap.explode();
		}
		
		public function activate() {
			gotoAndStop(1);
		}
	}
	
}
